This section contains technical information about the implementation of EWE. This information is subject to change with each release of EWE. However, the interface provided by the EWE classes will always be backwards compatible so that a EWE installation can be updated without breaking the site.
connect.php is the interface to the database. _base.php includes _ewe.php and checks to make sure the database access information exists. If not (or if incomplete), it redirects to _initfiles.php to attempt to create the file. This may fail if the php code is running without the necessary privileges to update _ewe.php (which is not a bad idea - the site will be more secure if _ewe.php is not writable by the php code). connect.php includes _base.php so that the setup check is done, then it connects to the database and reports an error if the connection fails. _prepare.php includes _base.php and then checks to make sure that the EWE has completed its initial setup. If not, it calls the Server.Setup() method - and possibly _setup.php - to start/complete the setup process. prepare.php includes _prepare.php and enforces HTTPS protocol if that is configured. It also logs the user in (via cookies).
The code dependency is as follows (vertical lines indicate includes, horizontal lines
indicate redirection):
prepare.php
|
v
_prepare.php
| |
v v -> adminsetup.php
connect.php _setup.php -|
| -> ewesetup.php
v
_base.php -> _initfiles.php -> setupinclude.php -> index.php
|
v
_ewe.php
_initfiles.php prompts the user for database access values, and then calls setupinclude.php. setupinclude.php creates _ewe.php from the user-provided values. If successful, it calls _setup.php.
_setup.php performs the user-interface portion of various setup stages.
_Setup.php -> adminsetup.php -> createadmin.php
|
-> admin.php
All of these files are found in the base folder.
ewe_serveradmin - main EWE table.
Items:
SETUP - indicates how far the setup process has progressed
NAME - EWE installation name
LANGUAGE - default language
VERSION - version of installed EWE
ewe_alerts - emails to send alerts to
ewe_backups - Backup set information
ewe_blacklist_n - Blacklists for site n
ewe_bots - IPs for bots
ewe_continents - information on continents
ewe_cookies - information on cookies
ewe_countries - information on countries
ewe_dbaccesses - table metrics information
ewe_errors - error text/code translation
ewe_errors_n - error logs for site n
ewe_event_names - name of events
ewe_events_n - event logs for site n
ewe_events_filter_n - event filters for site n
ewe_exposed - list of exposed passwords
ewe_geolocation - geolocation information
ewe_geolocation_asn - networks associated with IPs
ewe_geolocation_names - names of associated geolocation networks
ewe_geolocation_ips - geolocation information by IP ranges.
ewe_hook_names - names of hooks.
ewe_hooks - module hooks
ewe_intrusion - intrusion logs
ewe_languages - languages table
ewe_module_text - module-specific text and translations.
ewe_modules - installed modules
ewe_name_exclusions - excluded name list
ewe_password_dictionary - words to exclude from valid passwords
ewe_privileges - privileges
ewe_site_errors_n - error logs for site n
ewe_siteadmin_n - site settings for site n
ewe_sites - defined sites
ewe_states - information on country subdivisions (states/provinces/etc)
ewe_text_n - text for site n
ewe_users_n - users for site n
ewe_users_emails_n - emails for users for site n
ewe_users_info_n - user information for site n
ewe_users_privs_n - privileges for users for site n
ewe_whitelist_n - IPs allowed for users for site n